home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cug106
/
stdio.src
< prev
next >
Wrap
C/C++ Source or Header
|
1984-06-14
|
1KB
|
37 lines
/* stdio.src
Copyright (C) 1980, M J Maney
First created 3/15/80
Last revised 4/19/80 1:45
This file defines some useful functions that are designed to help
make BDS C programs running under CP/M pretend that they're
running in a nicer environment (like UNIX, ha-ha). It makes it
easier to setup and use STDIN and STDOUT directed IO, and
although you can't just assume that they're there as you can
with UNIX C, at least you don't have to put in code to parse
the command line into each program you write: just use the
functions here.
*/
#include "csym.lib"
#include "stdio.lib"
#define ESCAPE '\\'
/* stdopen parses the command line arguments looking for arguments that
begin with "<" or ">", which are respectively taken to be the
filenames for STDIN and STDOUT. The defaults are to use the
console for both STDIN and STDOUT. Any argument beginning with
"<" or ">" is effectively removed from the argument list (by
moving pointers in argv[] and decreasing argc)...if your program
wants to get an argument beginning with "<" or ">", you must
type it as "\<" or "\>", and stdopen will replace the escape
sequence in the strings, but will not "use" those arguments
for IO assignment. If you want to pass arguments beginning with
"\", you must type "\\" to escape the escape character.
NB: the escape character is ONLY significant to stdope